package com.zhang.hadoop.testMain;

import com.alibaba.fastjson.JSONObject;
import org.junit.Test;

/**
 * @author zhang yufei
 * @date 2022/6/28 18:27
 **/

public class Test8 {

    @Test
    public void test1(){
        Car car=new Car();
        String str=JSONObject.toJSONString(car);
        Car car1=JSONObject.parseObject(str,Car.class);
        System.out.println(car1.getName());

    }

    public static class Car{

        public String getName(){
            return "car";
        }

    }

}
